<template>
	<view class="flex-col page">
		<view class="flex-col group_5">
			<view class="flex-col list">
				<view class="list-item justify-between">
					<view class="left-group flex-row">
						<image
							src="http://images.wanjunshijie.com/product/cook/assets/6acf82dbf33586c087270d682f55d498.png"
							class="image_6" />
						<view class="right-group">
							<text>湖南省长沙市雨花区万象美域1220</text>
							<text class="text_7">李先生 <br /></text>
							<text>13687388731</text>
						</view>
					</view>
					<text class="text_10">编辑</text>
				</view>
				<view class="list-item justify-between group_7">
					<view class="left-group flex-row">
						<image
							src="http://images.wanjunshijie.com/product/cook/assets/6acf82dbf33586c087270d682f55d498.png"
							class="image_6" />
						<view class="right-group">
							<text>湖南省长沙市雨花区万象美域1220</text>
							<text class="text_7">李先生 <br /></text>
							<text>13687388731</text>
						</view>
					</view>
					<text class="text_10 text_15">删除</text>
				</view>
				<view class="list-item justify-between group_8">
					<view class="left-group flex-row">
						<image
							src="http://images.wanjunshijie.com/product/cook/assets/6acf82dbf33586c087270d682f55d498.png"
							class="image_6" />
						<view class="right-group">
							<text>湖南省长沙市雨花区万象美域1220</text>
							<text class="text_7">李先生 <br /></text>
							<text>13687388731</text>
						</view>
					</view>
					<text class="text_10">编辑</text>
				</view>
			</view>
			<view class="flex-col items-center button">
				<text>新增常用地址</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		addresslist
	} from '../../config/api.js'
	export default {
		data() {
			return {
				page: 1,
				list: []
			};
		},

		mounted() {
			this.getdata()
		},
		methods: {
			addlist() {
				uni.navigateTo({
					url: '/pages/address/add'
				})
			},
			getdata() {
				var that = this;
				that.page = 1
				addresslist({
					page: that.page
				}, {
					custom: {
						auth: true
					}
				}).then(res => {
					if (res.code == 1) {
						that.list = res.data
					}
				}).catch(err => {

				})
			},
			getmore() {
				var that = this;
				that.page = that.page + 1;
				addresslist({
					page: that.page
				}, {
					custom: {
						auth: true
					}
				}).then(res => {
					if (res.code == 1) {
						console.log(res.data)
						var data = res.data;
						for (var i = 0; i < data.length; i++) {
							that.list.push(data[i]);
						}
					}
				}).catch(err => {

				})
			},
		}
	};
</script>
<style scoped lang="scss">
	.page {
		background-color: rgb(255, 255, 255);
		width: 100%;
		height: 100%;
		overflow-y: auto;

		.group_5 {
			padding: 0 21rpx 85rpx 24rpx;
			flex: 1 1 auto;
			overflow-y: auto;

			.list {
				padding-top: 11rpx;

				.list-item {
					padding: 38rpx 0 7rpx 11rpx;

					&:not(:first-of-type) {
						border-bottom: solid 2rpx rgb(238, 238, 238);
					}

					.left-group {
						color: rgb(172, 170, 170);
						font-size: 24rpx;
						line-height: 40rpx;

						.image_6 {
							margin-top: 5rpx;
							width: 27rpx;
							height: 31rpx;
						}

						.right-group {
							margin-left: 19rpx;
							width: 471rpx;
							height: 82rpx;

							.text_7 {
								margin-left: 23rpx;
							}
						}
					}

					.text_10 {
						margin-top: 7rpx;
						color: rgb(182, 180, 180);
						font-size: 24rpx;
						line-height: 23rpx;
						white-space: nowrap;
					}

					.text_15 {
						margin-top: 8rpx;
						color: rgb(255, 112, 112);
					}
				}

				.group_7 {
					padding: 29rpx 0 15rpx 11rpx;
					margin-top: 9rpx;
					border-top: solid 2rpx rgb(238, 238, 238);
				}

				.group_8 {
					padding: 27rpx 0 17rpx 11rpx;
				}
			}

			.button {
				margin: 521rpx 28rpx 0 25rpx;
				padding: 18rpx 0;
				color: rgb(255, 255, 255);
				font-size: 30rpx;
				line-height: 29rpx;
				white-space: nowrap;
				background-color: rgb(247, 176, 18);
				border-radius: 15rpx;
			}
		}
	}
</style>
